package com.tensquare.entity;

/**
 * 分页结果类
 */
public class PageResult<T> {

    private int count;//总条数
    private int currentPage;//当前页
    private int prev;//上一页
    private int pages;//显示总页数
    private int next;//下一页
    private int limit;//分页数
    private int refresh;//刷新
    private int skip;//确定
    private int start;//开始条数

    public PageResult(){

    }


    public int getStart() {

        return start;
    }
    public void setStart(int start) {
        this.start = start;
    }
    public int getCount() {
        return count;
    }
    public void setCount(int count) {
        this.count = count;
    }
    public int getPrev() {
        return prev;
    }
    public void setPrev(int prev) {
        this.prev = prev;
    }
    public int getPages() {
        return pages;
    }
    public void setPages(int pages) {
        this.pages = pages;
    }
    public int getNext() {
        return next;
    }
    public void setNext(int next) {
        this.next = next;
    }
    public int getLimit() {
        return limit;
    }
    public void setLimit(int limit) {
        this.limit = limit;
    }
    public int getRefresh() {
        return refresh;
    }
    public void setRefresh(int refresh) {
        this.refresh = refresh;
    }
    public int getSkip() {
        return skip;
    }
    public void setSkip(int skip) {
        this.skip = skip;
    }


    public int getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(int currentPage) {

        this.currentPage = currentPage;
    }

    public int computerStart(){
        start = (currentPage - 1) * limit;
        return start;
    }

    @Override
    public String toString() {
        return "PageData [count=" + count + ", currentPage=" + currentPage + ", prev=" + prev + ", pages=" + pages
                + ", next=" + next + ", limit=" + limit + ", refresh=" + refresh + ", skip=" + skip + ", start="
                + start + "]";
    }


}
